package com.suixun.queue;

import java.util.Map;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.fasterxml.jackson.core.JsonGenerator;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.suixun.lib.httpsqs4j.HttpsqsClient;

public class SMSDeal {
	
	protected static Logger logger = LoggerFactory.getLogger(SMSDeal.class);
	    
    protected static String queuename = "sms";
    @Resource
    private HttpsqsClient syssqs;

    public void send(Map<String, String> arr) {
        if (syssqs != null) {
            try {
                ObjectMapper mapper = new ObjectMapper();
                mapper.getFactory().configure(JsonGenerator.Feature.ESCAPE_NON_ASCII, true);
                String jsonStr = mapper.writeValueAsString(arr);
                syssqs.putString(queuename, jsonStr);
            } catch (Exception e) {
                logger.error(e.getMessage(),e);
            }
        }
    }

}
